package se.robertfoss.ChanImageBrowser;

import android.os.Handler;
import android.os.Message;
import android.widget.ProgressBar;

public class ProgressBarHandler extends Handler{
	
	ProgressBar pb;
	
	public ProgressBarHandler(ProgressBar pb) {
		super();
		this.pb = pb;
	}

	@Override
	public void handleMessage(Message msg) {
		if (msg.arg1 == 0) {
			pb.setIndeterminate(false);
		} else {
			pb.setIndeterminate(true);
		}
		pb.setProgress(msg.arg2);
	}
}
